//Controller που ελεγχει την καταχωρηση του καταστηματος
package Controllers;

import DAO.StoreEntry_Dao;

public class StoreEntry_Validator {

    public StoreEntry_Validator(StoreEntry_Dao storeEntry_Dao) {

    }

    public StoreEntry_Validator() {

    }

    public boolean validateStoreEntry(String StoreName, String Address, String City, String StorePhone, String Floors, String Seats, String Parking, String ParkingSpots, String DaysOpen) {
        boolean x = true;
        if (StoreName.isEmpty() || Address.isEmpty() || StorePhone.isEmpty() || Floors.isEmpty() || City.isEmpty() || ParkingSpots.isEmpty() || DaysOpen.isEmpty() || Parking.isEmpty() || Seats.isEmpty()) {
            x = false;
        } else if (StorePhone.length() > 10 || StorePhone.length() < 10) {
            x = false;
        } else if (StorePhone.matches("[0-9]+") == false) {
            x = false;
        } else if (Floors.matches("[0-9]+") == false) {
            x = false;

        } else if (Seats.matches("[0-9]+") == false) {
            x = false;
        } else if (ParkingSpots.matches("[0-9]+") == false) {
            x = false;
        } else if (StoreName.length() > 25) {
            x = false;
        }
        return x;
    }
}
